Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Added new create-poll button in post drafting interface (no forms linked yet) #43

Merged
merged 10 commits into from
Feb 11, 2025

Conversation

yukiiii04
Copy link
Contributor

@yukiiii04 yukiiii04 commented Feb 11, 2025

WIP Explanation
The frontend button is working, but the only thing making this issue an "WIP" is our issues with node_module files. Read Testing & Validations for further explanation.

Context
Resolved specific task issue #37 and addresses parent issue #32 by creating a hover-able button in the post drafting interface. Addresses the user story for polls/surveys in P1A.

Description
Created a button with polls icon imported from font awesome icon library. This button shows up next to the upload-file button for admin and next to the upload-image button for all other users due to privilege constraints. Dependent on Instructors group created in add-role-groups branch (criteria cleared and was installed when working on this feature).

When clicked, there is no prompt for the polls yet and the preview + backend aggregation have not been set up yet. This will be implemented in sprint 2 by @yukiiii04 & @lynzhlang .

Codebase Changes

  • ./public/language/en-US/admin/manage/categories.json: define create-poll as a category management setting
  • ./public/language/en-US/admin/manage/privileges.json: adds create-poll as a new user privilege
  • ./public/language/en-US/modules.json: adds create-poll to the composer module
  • ./node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-formatting.tpl: this is the partial that is reused when making post draft. Edited so that new list item (create-poll button) is included in template.
  • .gitignore: unignore the specific file we want to commit

Testing & Validations

  • had teammates pull code from branch + manually insert changed code in node_modules (1 file, 4 lines) since it does not sync up to remote repo. This issue is not solved yet despite contacting multiple TAs and the professors, but will be addressed for sprint 2.
  • Tested on local system for frontend to show up: it did & no unexpected behavior was found switching between accounts and between roles (admin vs. instructor vs. base user).

**Next step: ** @lynzhlang is joining me to work on the these #38 , #39 , #40 . The goal is to get this feature implemented and tested by Saturday, February 22nd.

Current progress
Screenshot 2025-02-11 at 18 01 45

@yukiiii04 yukiiii04 self-assigned this Feb 11, 2025
@lynzhlang
Copy link
Contributor

I took a look at your changes and tested your code on my laptop. This works fine on my end!

'groups:ban', 'groups:upload:post:file', 'create-poll']), 'Global Moderators');
await privileges.global.give(['groups:view:users', 'groups:view:tags', 'groups:view:groups', 'create-poll'], 'guests');
await privileges.global.give(['groups:view:users', 'groups:view:tags', 'groups:view:groups', 'create-poll'], 'spiders');
await privileges.global.give(['groups:view:users', 'groups:view:tags', 'groups:upload:post:file', 'groups:view:groups', 'create-poll'], 'Instructors');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwjulie can you review this and see if these changes will break anything (I don't think they will but I'm also not 100% sure if this is necessary). I was attempting to add create-poll as a privilege to all the current roles. 😆 ❤️ ☮️ ✌️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Adding the create-polls privilege should not cause issues with anything I have implemented.

@yukiiii04
Copy link
Contributor Author

For reference, here is the changes made in the node_modules file. We have to wait for prof's response on this issue.

Screenshot 2025-02-11 at 18 29 49

@yukiiii04 yukiiii04 merged commit a94d727 into main Feb 11, 2025
1 check passed
@lynzhlang
Copy link
Contributor

Yuki and I talked with multiple TAs and instructors and received different responses across the entire group, so we were not able to figure out how to commit our front end changes!

@yukiiii04 yukiiii04 added this to the Sprint 1 milestone Feb 12, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13274577043

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 82.668%

Files with Coverage Reduction New Missed Lines %
src/groups/join.js 1 92.05%
Totals Coverage Status
Change from base Build 13265998579: -0.008%
Covered Lines: 22323
Relevant Lines: 25582

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants